<?php

namespace app\index\controller;

use think\Db;
use think\File;

/************************************************
 * 
 * 举报模块
 * 
 * ***********************************************
 */

class Complaint extends Common {

    protected $table = 'chat_complainttype';
    protected $log_table = 'chat_complaint';

    //获取举报标签
    public function getComplaintTag() {
        
        $data = Db::table($this->table)
            ->select();
      
        return retData($data, '1000', 'ok');
    }
    
    
    //举报行为
    public function publishComplaint() {       
         $insert = [
            'user_uid' => input('param.user_uid'),
            'complaint_type' => input('param.complaint_type'),
            'complaint_type_name' => input('param.complaint_type_name'),
            'complaint_user_uid' => input('param.complaint_user_uid'),
            'pic' => input('param.pic'),
            'app_flag' => input('param.app_flag'),
            'ctime' => time(),
            'content' => input('param.content'),
        ];
        $data = Db::table($this->video_table)->insert($insert);
        if($data){
            return retData([], '1000', 'ok');
        }else {
            return retData([], '1001', '发布失败');
        }  
    }
    
    
      // 上传视频 
    public function uploadImg() {
        $data = MediaUpload('complaint', 0);
        return $data;
    }

}
